package com.example.login.mapper;

import com.example.login.entity.Order;
import com.example.login.entity.OrderInfo;
import com.example.login.entity.UserAuthCode;
import com.example.login.entity.UserDormCorrinfo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {
    public List<Map<String, String>> countFreeRooms();
    public List<String> getAllBuildingName();
    //根据authCode查询是否存在
    public UserAuthCode findIsExistAuthCode(String authCode);
    /**
     * 根据uid查询用户信息（number, name, gender）
     */
    public Map<String, String> findUserInfoByUid(int uid);
    //查出来有几间符合要求的宿舍
    public List<Map<String, Object>> getDormByOrder(String buildingName, String gender, int num);
    public int updateGrabedRoom(int roomId, int num);

    //写入Order表
    public int insertOrder(Order order);
    public int insertOrderInfo(OrderInfo orderInfo);

    public int findBuildingIdByBuildingName(String buildingName);

    public int insertUserDormCorrinfo(UserDormCorrinfo userDormCorrinfo);
}